<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>控制复选框的全选和取消全选</title>
</head>
<body>
    <input type="checkbox" checked>
    <input type="radio" checked="checked">

    <hr>

    <table border="1">
        <tr>
            <th><input id="all" type="checkbox"></th>
            <th>姓名</th>
            <th>年龄</th>
            <th>电话</th>
        </tr>
        <tr>
            <td><input id="c1" name="chk" type="checkbox"></td>
            <td>aaa</td>
            <td>bbb</td>
            <td>ccc</td>
        </tr>
        <tr>
            <td><input id="c2" name="chk" type="checkbox"></td>
            <td>aaa</td>
            <td>bbb</td>
            <td>ccc</td>
        </tr>
        <tr>
            <td><input id="c3" name="chk" type="checkbox"></td>
            <td>aaa</td>
            <td>bbb</td>
            <td>ccc</td>
        </tr>
        <tr>
            <td><input id="c4" name="chk" type="checkbox"></td>
            <td>aaa</td>
            <td>bbb</td>
            <td>ccc</td>
        </tr>
        <tr>
            <td><input id="c5" name="chk" type="checkbox"></td>
            <td>aaa</td>
            <td>bbb</td>
            <td>ccc</td>
        </tr>
    </table>


    <script></script>
</body>
</html>